//
//  UIButton+Extension.swift
//  weibo
//
//  Created by shixiaoyang on 16/4/7.
//  Copyright © 2016年 shixiaoyang. All rights reserved.
//

import UIKit

import Foundation
extension UIButton {
    
    /// 使用 `图像名` 和 `背景图像名` 创建按钮
    ///
    /// - parameter imageName:     imageName
    /// - parameter backImageName: backImageName
    ///
    /// - returns: UIButton
    convenience init(imageName: String, backImageName: String) {
        self.init()
        
        setImage(UIImage(named: imageName), forState: .Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: .Highlighted)
        setBackgroundImage(UIImage(named: backImageName), forState: .Normal)
        setBackgroundImage(UIImage(named: backImageName + "_highlighted"), forState: .Highlighted)
    }
}